<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03_js的数据类型</title>
</head>
<body>
<script>
    var a = 1;
    var b = 3.14;
    var c = "c";
    var d = 'd';
    var e = true;
    var f = null;
    var g;

    console.log(a, typeof a, b, typeof b, c, typeof c, d, typeof d, e, typeof e, f, typeof f, g, typeof g);
    var cat = {};
    console.log(cat, typeof cat);
    var obj = {
        name: "小狗",
        age: 3
    };
    console.log(obj, typeof obj);
    obj.like = "骨头";
    console.log(obj.like, typeof obj.like);
    console.log(obj.gender)
    let arr = ['张三', 18, true, 6.7];
    console.log(arr, typeof arr, arr[0], arr[33]);

//    boolean()
    console.log(Boolean(0));
    console.log(Boolean(''));
    console.log(Boolean(""));
    console.log(Boolean(false));
    console.log(Boolean(null));
    console.log(Boolean(undefined));
    console.log(Boolean(NaN));
    console.log(Boolean(1));
    console.log(Boolean(2));
    console.log(Boolean(true));
    console.log(Boolean(" "));
    console.log(Boolean("12"));

    console.log(Number(true),typeof Number(true));
    console.log(Number(false),typeof Number(false));
    console.log(Number(1),typeof Number(1));
    console.log(Number('3'),typeof Number('3'));
    console.log(Number("3"),typeof Number("3"));
    console.log(Number('哈哈哈'),typeof Number('哈哈哈'));
    console.log(typeof NaN);
</script>
</body>
</html>